<template>
  <div class="container">

    <div>
      <van-nav-bar title="商圈云用户调研"
                   left-text=""
                   @click-left="onClickLeft"
      />
    </div>

    <div>

      <van-form @submit="onSubmit">
        <div class="text">
          尊敬的商圈云用户,商圈云平台为给广大经销商朋友提供更全面、更优质、更便利的全方位服务，解决大家运营过程中存在的各方面问题，现针对软件功能、运营模式、内部管理、法律咨询、记账管理、保险定制等方面的需求进行调研，请大家认真填写，感谢您的支持！！！
        </div>

        <div class="text1">
          1、	目前软件功能能否满足您的业务模式？
        </div>
        <div >
          <van-radio-group v-model="xq1" 	class="rownr">
            <van-radio name="1" style="padding-top: 10px;padding-left: 40px;">是</van-radio>
            <van-radio name="2" style="padding-top: 10px;padding-left: 40px;">否</van-radio>
          </van-radio-group>
        </div>

        <div class="text1">
          2、	您是否有车销改跑单的计划，降低退货率，提高工作效率？
        </div>
        <div>
          <van-radio-group v-model="xq2"  class="rownr">
            <van-radio name="1" style="padding-top: 10px;padding-left: 40px;">是</van-radio>
            <van-radio name="2" style="padding-top: 10px;padding-left: 40px;">否</van-radio>
          </van-radio-group>
        </div>

        <div class="text1">
          3、	您是否遇到运营产品的退货率过高，盈利水平低的问题？
        </div>
        <div>
          <van-radio-group v-model="xq3"  class="rownr">
            <van-radio name="1" style="padding-top: 10px;padding-left: 40px;">是</van-radio>
            <van-radio name="2" style="padding-top: 10px;padding-left: 40px;">否</van-radio>
          </van-radio-group>
        </div>

        <div class="text1">
          4、	您是否有对业务员进行内部管理、业务能力提升的培训计划？
        </div>
        <div>
          <van-radio-group v-model="xq4" class="rownr">
            <van-radio name="1" style="padding-top: 10px;padding-left: 40px;">是</van-radio>
            <van-radio name="2" style="padding-top: 10px;padding-left: 40px;">否</van-radio>
          </van-radio-group>
        </div>

        <div class="text1">
          5、	您是否有法律咨询方面的需求，如员工不签劳动合同、不交社保如何处理，员工私自卖货、侵吞货款如何处理等。
        </div>
        <div>
          <van-radio-group v-model="xq5"  class="rownr">
            <van-radio name="1" style="padding-top: 10px;padding-left: 40px;">是</van-radio>
            <van-radio name="2" style="padding-top: 10px;padding-left: 40px;">否</van-radio>
          </van-radio-group>
        </div>

        <div class="text1">
          6、	您是否遇到过被员工申请仲裁、员工恶意讹诈的糟心处境？
        </div>
        <div>
          <van-radio-group v-model="xq6"  class="rownr">
            <van-radio name="1" style="padding-top: 10px;padding-left: 40px;">是</van-radio>
            <van-radio name="2" style="padding-top: 10px;padding-left: 40px;">否</van-radio>
          </van-radio-group>
        </div>

        <div class="text1">
          7、	您是否担心公司财务掌握情况太多方面的风险？
        </div>
        <div>
          <van-radio-group v-model="xq7"  class="rownr">
            <van-radio name="1" style="padding-top: 10px;padding-left: 40px;">是</van-radio>
            <van-radio name="2" style="padding-top: 10px;padding-left: 40px;">否</van-radio>
          </van-radio-group>
        </div>

        <div class="text1">
          8、	您是否遇到购买的车辆保险、人员意外伤害保险等不能规避您的所有风险的问题？
        </div>
        <div>
          <van-radio-group v-model="xq8"  class="rownr">
            <van-radio name="1" style="padding-top: 10px;padding-left: 40px;">是</van-radio>
            <van-radio name="2" style="padding-top: 10px;padding-left: 40px;">否</van-radio>
          </van-radio-group>
        </div>

        <div class="text1">
          9、	您是否每年组织团队建设，如集体旅游、集体培训等，提高员工积极性和忠诚度？
        </div>
        <div >
          <van-radio-group v-model="xq9"  class="rownr">
            <van-radio name="1" style="padding-top: 10px;padding-left: 40px;">是</van-radio>
            <van-radio name="2" style="padding-top: 10px;padding-left: 40px;">否</van-radio>
          </van-radio-group>
        </div>

        <div class="text1">
          10、	您是否计划参加运营管理方面的相关培训？
        </div>
        <div>
          <van-radio-group v-model="xq10"  class="rownr">
            <van-radio name="1" style="padding-top: 10px;padding-left: 40px;">是</van-radio>
            <van-radio name="2" style="padding-top: 10px;padding-left: 40px;">否</van-radio>
          </van-radio-group>
        </div>

        <div class="text1">
        11、	其他需求
      </div>
        <div>
          <van-field
            v-model="qtxq"
            rows="4"
            autosize
            label=""
            type="textarea"
            maxlength="200"
            placeholder="请输入内容"
            show-word-limit
          />
        </div>

        <div>

          <van-field
            v-model="telephone"
            label="手机号："
            label-width="20%"
            placeholder="请输入手机号"
            v-if="!agencyid"
          />

        </div>

        <div style="margin-top: 40px;margin-left: 16px;margin-right: 16px;padding-bottom: 50px;">
          <van-button round block type="info" native-type="submit">提交</van-button>
        </div>

      </van-form>


    </div>
    </div>
</template>

<script>
  import {saveReport,saveReportReadNum } from 'api/api'
  import {Toast} from 'vant'
  export default {
    name: 'myquanzi',
    data() {
      return {
        xq1:'',
        xq2:'',
        xq3:'',
        xq4:'',
        xq5:'',
        xq6:'',
        xq7:'',
        xq8:'',
        xq9:'',
        xq10:'',
        agencyid:'',
        qtxq:'',
        telephone:''

      }
    },
    created() {
      const agencyId = this.$route.query.agencyId
      this.agencyid = agencyId
      this.saveReportReadNum()
    },
    methods: {
      onClickLeft() {
        this.$router.go(-1) // 返回上一层
      },

      onSubmit(){
        let param = {}
        param.agencyid = this.agencyid
        param.telephone = this.telephone
        param.xq1 = this.xq1
        param.xq2 = this.xq2
        param.xq3 = this.xq3
        param.xq4 = this.xq4
        param.xq5 = this.xq5
        param.xq6 = this.xq6
        param.xq7 = this.xq7
        param.xq8 = this.xq8
        param.xq9 = this.xq9
        param.xq10 = this.xq10
        param.qtxq = this.qtxq

        if(!param.agencyid){
          if(!param.telephone){
            Toast.fail('请输入您的手机号，以便给您反馈')
            return
          }
        }

        saveReport(param).then(response => {
          if (response.code === 200) {
            Toast.success('保存成功')
          }else{
            Toast.fail(response.msg)
          }
        })

      },

      saveReportReadNum(){
        let param = {}
        param.dictType = 'report_readed'
        saveReportReadNum(param).then(response => {
          if (response.code === 200) {

          }else{
            // Toast.fail(response.msg)
          }
        })
      }

    }

  }
</script>

<style scoped>

  .container{
    background-color: white;
    height: auto;
  }

  .columnr{
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
  }

  .rownr{
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
    font-size: 16px;
  }

  .content{
    font-size: 16px;
    padding:10px;
    width: 80%;
  }

  .text{
    text-indent: 32px;
    padding-left: 10px;
    padding-right: 10px;
    font-size: 16px;
    padding-top: 10px;
    line-height: 200%;
  }

  .text1{
    padding-left: 10px;
    padding-right: 10px;
    font-size: 16px;
    padding-top: 15px;
    line-height: 200%;
  }


</style>
